﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CaffeeBuzz_WinForm.Shared
{
    public class Utils
    {
        
        public static int ReadAndCheck(int min, int max)
        {
            Console.Write("Choose: ");
            bool loop = true;
            int k;
            do
            {
                k = int.Parse(Console.ReadLine());
                if (k < min || k >= max)
                {
                    Console.WriteLine("\n Choose fail! Try again, please..\nChoose:");
                }
                else
                    loop = false;

            }
            while (loop);

            return k;
            
            
        }

    }
}
